# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=phrasendrescher
pkgver=1.2.2c
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-cracker')
pkgdesc='A modular and multi processing pass phrase cracking tool.'
arch=('x86_64' 'aarch64')
url='http://www.leidecker.info/projects/phrasendrescher/'
license=('BSD')
depends=('openssl' 'libssh2' 'gpgme')
options=('!libtool')
source=("http://www.leidecker.info/projects/$pkgname/$pkgname-$pkgver.tar.gz"
        "$pkgname.patch")
sha512sums=('33db44b309de299399b1fd649e01e59a35b3cfb92065f2482fe6029454efca36f6c122ec38402d1e34bd511e2485e9f50ed5d89442e84af61f85728229dd2f47'
            '9acce92048e3bb5f57c5a3a1abdba855543fb070bda6f24fc0af99b42f6b6d1e7432c370bead2976f2ef1757f77a84765168d2c774e911a7249eaa06fa402f2c')

prepare() {
  cd "$pkgname-$pkgver"

  #patch -p0 -i "../$pkgname.patch"
}

build() {
  cd "$pkgname-$pkgver"

  if [[ "$CARCH" == "i686" || "$CARCH" == "x86_64" ]];
  then
    ./configure --prefix=/usr --with-plugins
  else
    ./configure --build=arm --prefix=/usr --with-plugins
  fi

  make
}

package() {
  cd "$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install

  # Fix conflict with community/pd.
  mv "$pkgdir/usr/bin/pd" "$pkgdir/usr/bin/$pkgname"
  mv "$pkgdir/usr/share/man/man1/pd.1" "$pkgdir/usr/share/man/man1/$pkgname.1"
}

